package cn.tedu.baking.controller;

import cn.tedu.baking.base.response.JsonResult;
import cn.tedu.baking.pojo.vo.BannerIndexVO;
import cn.tedu.baking.service.BannerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/banners")
public class BannerController {
    @Autowired
    private BannerService bannerService;
    @GetMapping("index")
    public JsonResult listForIndex() {
        List<BannerIndexVO> list = bannerService.listForIndex();
        log.debug("banner列表查询成功，数据：{}", list);
        return JsonResult.ok(list);
    }

}
